﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AddNews.aspx.cs" Inherits="Admin_AddNews"  EnableViewState="false" EnableSessionState="False"%>

<%@ Register Src="adminfoot.ascx" TagName="adminfoot" TagPrefix="uc1" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link rel="stylesheet" href="imgs/admin.css" type="text/css" media="all" />
    <script type="text/javascript" src="../DotNet_net/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../DotNet_net/js/jquery.form.js"></script>
</head>
<body onload='$("#loading").hide()'>
<div id="loading" style="display:block">   
    <div class="loading-indicator">   
        页面正在加载中...   
    </div>   
</div> 
    <form name="addform" id="addformAjax"  method="post">
    <div class="container" id="cpcontainer">   
   <table class="tb">
        <tr class="thead" ><td colspan="4">
            新闻添加(<font color='red'>＊</font>为必填,其它选填)</td>
            <td colspan="1">
            </td>
        </tr>
        <tr>
            <td width="12%" style="height: 31px">
                新闻名称(newsName)：</td>
            <td colspan="3" style="height: 31px">
                <input id="newsName" name="newName" type="text" />
                &nbsp;<font color='red'>＊</font><span id="m_name_ok"></span>类 型：
              <%=NewsClassDp("newsStyle")%></td>
            <td colspan="1" style="height: 31px">
            </td>
        </tr>
       <tr>
           <td style="height: 31px" width="6%">
               新闻名称颜色：</td>
           <td colspan="3" style="height: 31px">
         <select name="title_color" id="color" style="width:100px">
		<option value="" selected="selected">标题颜色</option>
        <option style="background-color:#FF0000;color: #FF0000" value="#FF0000">红色</option> 
        <option style="background-color:#FF33CC;color: #FF33CC" value="#FF33CC">粉红</option>  
        <option style="background-color:#00FF00;color: #00FF00" value="#00FF00">绿色</option>
        <option style="background-color:#0000CC;color: #0000CC" value="#0000CC">深蓝</option>
        <option style="background-color:#FFFF00;color: #FFFF00" value="#FFFF00">黄色</option>
        <option style="background-color:#660099;color: #660099" value="#660099">紫色</option>
        <option style="" value="">无  色</option>
		</select>
           </td>
           <td colspan="1" style="height: 31px">
           </td>
       </tr>
		<tr>
            <td colspan="4">&nbsp;<img src='imgs/btn_add.gif' class='pointer' align='absmiddle' onclick="$('#seo').stop().toggle()"/>&nbsp;&nbsp;新闻<font color="red">新闻优化设置(包括头部,关键字,描述,底部)</font></td>
            <td colspan="1">
            </td>
        </tr>
       <tr>
           <td colspan="4">
               <table id="seo" style="display: none" width="100%">
                   <tr>
                       <td style="width:12%; height: 56px">
                           页面标题(nTitle)：</td>
                       <td style="height: 56px">
                           <textarea id="TextArea1" name="nTitle" style="width: 490px; height: 69px">例如:XXXXX产品-xxx公司名称</textarea></td>
                   </tr>
                   <tr>
                       <td style=" height: 56px">
                           页面关键字(nKey)：</td>
                       <td style="height: 56px">
                           <textarea id="Textarea2" name="nKey" style="width: 490px; height: 69px">例如:关键字A 关键字B 关键字C 关键字D 关键字E 最后是5个,(过多的关键字会导致惩罚)</textarea></td>
                   </tr>
                   <tr>
                       <td style=" height: 56px">
                           页面描述(nDescription)：</td>
                       <td style="height: 56px">
                           <textarea id="Textarea3" name="nDescription" style="width: 490px; height: 69px">例如:优网公司专门从事企业网站建设,优化,整合服务一体的的外包公司,提供最专业,最稳定,及最实惠的服务(简短不超过100中文字个描述)</textarea></td>
                   </tr>
                   <tr>
                       <td style=" height: 56px">
                           底部描述(nButtom)：</td>
                       <td style="height: 56px">
                           <textarea id="Textarea4" name="nButtom" style="width: 490px; height: 69px">例如:XXX产品 XXX产品1 XX产品2等等</textarea></td>
                   </tr>
               </table>
           </td>
           <td colspan="1">
           </td>
       </tr>
        <tr>
            <td style="height: 31px">
                新闻详细(newInfor)：</td>
            <td colspan="3" style="height: 31px"><fckeditorv2:fckeditor id="FCKeditor1" runat="server" height="300px" toolbarset="Zrnet" width="650px" ></fckeditorv2:fckeditor></td>
            <td colspan="1" style="height: 31px">
            </td>
        </tr>
        <tr>          
      <td width="6%"></td>
      <td class="forumRow" style="height: 27px" ><input type="button" class="btn" value="确认保存" name="Submit" id="tijiao"  />&nbsp;<input type="reset" class="btn" value="清 除"  onclick="resetCon('FCKeditor1')">&nbsp;<input type=button class="btn" value="返　回" onClick="javascript:location.href='adminNew.aspx';"/></td>
        </tr>
    </table>    
<script type="text/javascript">
function resetCon(source) {
    //document.addform.reset();
    var oEditor=FCKeditorAPI.GetInstance(source).EditorDocument.body.innerHTML="";
    return false;
}
</script>
<script type="text/javascript">
$(document).ready(function(){
    var options = { 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse,  // post-submit callback 
        // other available options: 
         url:       "?state=insert",         // override for form's 'action' attribute 
       // type:        'post'        // 'get' or 'post', override for form's 'method' attribute 
        //dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
        clearForm: true,        // clear all form fields after successful submit 
        resetForm: true        // reset the form after successful submit 
 
        // $.ajax options can be used here too, for example: 
        //timeout:   3000 
    }; 
    $('#tijiao').click(function(){
         $("#loading").show();   
         if($("#newsName").attr("value")!="")
         {            
            var oEditor = FCKeditorAPI.GetInstance("FCKeditor1") ;   
            oEditor.UpdateLinkedField(); 
            $('#addformAjax').ajaxSubmit(options); 
            return false;
         }
         else
         {
            alert("新闻标题不能为空！");
            $("#loading").hide();
         }
    });
})
function showResponse(msg)
{ 
if(msg=="1")
{
    alert("添加成功!!!");
    $("#loading").hide();
    location.href=location.href;
} 
else
{
    alert(msg);
    $("#loading").hide();
}
}

function showRequest(formData, jqForm, options)
 { 		
    return true; 
} 

</script>
 </div>
<uc1:adminfoot ID="Adminfoot1" runat="server" />
    </form>

</body>
</html>
